//
//  RecommendCollectionReusableView.m
//  MarianasTrench
//
//  Created by 付建国 on 16/3/18.
//  Copyright © 2016年 王爵. All rights reserved.
//

#import "RecommendCollectionReusableView.h"

@interface RecommendCollectionReusableView ()

@property (nonatomic, strong) UILabel *titleL;/**< 分区标题 */
@property (nonatomic, strong) UIButton *moreButton;/**< 更多按钮 */

@end

@implementation RecommendCollectionReusableView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.titleL = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, SCREEN_WIDTH - 50, 30)];
        [self addSubview:_titleL];
        
        self.moreButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _moreButton.frame = CGRectMake(SCREEN_WIDTH - 50, 0, 50, 30);
        [_moreButton setTitle:@"更多>" forState:UIControlStateNormal];
        [self addSubview:_moreButton];
        _moreButton.titleLabel.font = [UIFont systemFontOfSize:13];
        [_moreButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [_moreButton addTarget:self action:@selector(moreButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    
    return self;
}
// 更多的点击方法
- (void)moreButtonAction:(UIButton *)button{
    if ([_titleL.text isEqualToString:@"小编推荐"]) {
        
        [self.Delegat clicktop:1];
        
    }else if([_titleL.text isEqualToString:@"精品听单"]){
        
        [self.Delegat clicktop:2];
        
    }else if([_titleL.text isEqualToString:@"听新闻"]){
        
        [self.Delegat clicktop:3];
        
    }else if ([_titleL.text isEqualToString:@"听小说"]){
        
        [self.Delegat clicktop:4];
        
    }else if ([_titleL.text isEqualToString:@"听脱口秀"]){
        
        [self.Delegat clicktop:5];
        
    }else if ([_titleL.text isEqualToString:@"听娱乐"]){
        
        [self.Delegat clicktop:6];
        
    }else if ([_titleL.text isEqualToString:@"听相声"]){
        
        [self.Delegat clicktop:7];
        
    }else if ([_titleL.text isEqualToString:@"听音乐"]){
        
        [self.Delegat clicktop:8];
        
    }else if ([_titleL.text isEqualToString:@"听情感心声"]){
        
        [self.Delegat clicktop:9];
        
    }else if ([_titleL.text isEqualToString:@"听历史"]){
        
        [self.Delegat clicktop:10];
        
    }else if ([_titleL.text isEqualToString:@"听公开课"]){
        
        [self.Delegat clicktop:11];
        
    }else if ([_titleL.text isEqualToString:@"听广播剧"]){
        
        [self.Delegat clicktop:12];
        
    }else if ([_titleL.text isEqualToString:@"听儿童故事"]){
        
        [self.Delegat clicktop:13];
        
    }else if ([_titleL.text isEqualToString:@"听旅游"]){
        
        [self.Delegat clicktop:14];
        
    }else if ([_titleL.text isEqualToString:@"听外语"]){
        
        [self.Delegat clicktop:15];
        
    }else if ([_titleL.text isEqualToString:@"听ACG"]){
        
        [self.Delegat clicktop:16];
        
    }else if([_titleL.text isEqualToString:@"热门"]){
        
        [self.AnchorDelegat clickToMore:@"hot" MoreTitle:@"热门"];
        
//    }else if([_titleL.text isEqualToString:@"新晋主播"]){
//        
//        [self.AnchorDelegat clickToMore:1];
        
    }else if ([_titleL.text isEqualToString:@"新闻"]){
        
        [self.AnchorDelegat clickToMore:@"news" MoreTitle:@"新闻"];
        
    }else if ([_titleL.text isEqualToString:@"有声小说"]){
        
        [self.AnchorDelegat clickToMore:@"book" MoreTitle:@"有声小说"];
        
    }else if ([_titleL.text isEqualToString:@"音乐台"]){
        
        [self.AnchorDelegat clickToMore:@"music" MoreTitle:@"音乐台"];
        
    }else if ([_titleL.text isEqualToString:@"相声评书"]){
        
        [self.AnchorDelegat clickToMore:@"comic" MoreTitle:@"相声评书"];
        
    }else if ([_titleL.text isEqualToString:@"综艺娱乐"]){
        
        [self.AnchorDelegat clickToMore:@"entertainment" MoreTitle:@"综艺娱乐"];
        
    }else if ([_titleL.text isEqualToString:@"情感生活"]){
        
        [self.AnchorDelegat clickToMore:@"emotion" MoreTitle:@"情感生活"];
        
    }else if ([_titleL.text isEqualToString:@"历史人文"]){
        
        [self.AnchorDelegat clickToMore:@"culture" MoreTitle:@"历史人文"];
        
    }else if ([_titleL.text isEqualToString:@"教育机构"]){
        
        [self.AnchorDelegat clickToMore:@"xmlydx" MoreTitle:@"教育机构"];
        
    }else if ([_titleL.text isEqualToString:@"外语"]){
        
        [self.AnchorDelegat clickToMore:@"train" MoreTitle:@"外语"];
        
    }else if ([_titleL.text isEqualToString:@"旅游"]){
        
        [self.AnchorDelegat clickToMore:@"trip" MoreTitle:@"旅游"];
        
    }else if ([_titleL.text isEqualToString:@"培训讲座达人"]){
        
        [self.AnchorDelegat clickToMore:@"chair" MoreTitle:@"培训讲座达人"];
        
    }else if ([_titleL.text isEqualToString:@"儿童"]){
        
        [self.AnchorDelegat clickToMore:@"kid" MoreTitle:@"儿童"];
        
    }else if ([_titleL.text isEqualToString:@"电台"]){
        
        [self.AnchorDelegat clickToMore:@"radio" MoreTitle:@"电台"];
        
    }else if ([_titleL.text isEqualToString:@"商业财经"]){
        
        [self.AnchorDelegat clickToMore:@"finance" MoreTitle:@"商业财经"];
        
    }else if ([_titleL.text isEqualToString:@"汽车"]){
        
        [self.AnchorDelegat clickToMore:@"car" MoreTitle:@"汽车"];
        
    }else if ([_titleL.text isEqualToString:@"电台DJ"]){
        
        [self.AnchorDelegat clickToMore:@"njdj" MoreTitle:@"电台DJ"];
        
    }else if ([_titleL.text isEqualToString:@"戏曲"]){
        
        [self.AnchorDelegat clickToMore:@"opera" MoreTitle:@"戏曲"];
        
    }else if ([_titleL.text isEqualToString:@"IT科技"]){
        
        [self.AnchorDelegat clickToMore:@"it" MoreTitle:@"IT科技"];
        
    }else if ([_titleL.text isEqualToString:@"健康养生"]){
        
        [self.AnchorDelegat clickToMore:@"health" MoreTitle:@"健康养生"];
        
    }else if ([_titleL.text isEqualToString:@"音乐人"]){
        
        [self.AnchorDelegat clickToMore:@"musician" MoreTitle:@"音乐人"];
        
    }else if ([_titleL.text isEqualToString:@"翻唱"]){
        
        [self.AnchorDelegat clickToMore:@"cover" MoreTitle:@"翻唱"];
        
//    }else if ([_titleL.text isEqualToString:@"古风"]){
//        
//        [self.AnchorDelegat clickToMore:23];
//        
//    }else if ([_titleL.text isEqualToString:@"名人"]){
//        
//        [self.AnchorDelegat clickToMore:24];
        
    }else if ([_titleL.text isEqualToString:@"说书人"]){
        
        [self.AnchorDelegat clickToMore:@"storytelling" MoreTitle:@"说书人"];
        
    }else if ([_titleL.text isEqualToString:@"声优/配音"]){
        
        [self.AnchorDelegat clickToMore:@"character" MoreTitle:@"声优/配音"];
        
    }else if ([_titleL.text isEqualToString:@"社团机构"]){
        
        [self.AnchorDelegat clickToMore:@"corporation" MoreTitle:@"社团机构"];
        
    }else if ([_titleL.text isEqualToString:@"校园电台"]){
        
        [self.AnchorDelegat clickToMore:@"campus" MoreTitle:@"校园电台"];
        
    }else if ([_titleL.text isEqualToString:@"美女主播"]){
        
        [self.AnchorDelegat clickToMore:@"mm" MoreTitle:@"美女主播"];
        
    }else if ([_titleL.text isEqualToString:@"其他"]){
        
        [self.AnchorDelegat clickToMore:@"other" MoreTitle:@"其他"];
        
    }else if ([_titleL.text isEqualToString:@"百视通专区"]){
        
        [self.AnchorDelegat clickToMore:@"baishitong" MoreTitle:@"百视通专区"];
        
    }else if ([_titleL.text isEqualToString:@"央广文艺之声"]){
        
        [self.AnchorDelegat clickToMore:@"ygwyzs" MoreTitle:@"央广文艺之声"];
        
    }

}

- (void)setTitle:(NSString *)title{
    _titleL.text = title;
    if ([title isEqualToString:@"节目榜单"] || [title isEqualToString:@"主播榜单"]) {
        [_moreButton setTitle:@"" forState:UIControlStateNormal];
    }
}




@end
